/*
 * Copyright 2011 Michael Nitsche
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.abcsolutions.g5.node;

import java.security.Timestamp;


/**
 * @author Michael Nitsche
 * 01.03.2011	Created
 */
public class NodeInfo2 {

	private final byte[] nodeId;
	private byte versionProto, availability;
	private byte[] ipv4, ipv6, portUdp, portTcp, sendingPort;
	private byte[][] features, itsPrimaryPartners;
	private boolean isSuperNode, usesDynDns, offersChat, offersMessageBoard;
	private int networkRunTime, networkDistance;
	private String userAlias, dynDnsAddress, versionAlias, publicKeyE, publicKeyN;
	private Timestamp lastTry, lastHeard;


	public NodeInfo2(byte[] nodeId) {
		this.nodeId=nodeId;
	}


	public boolean equals(Object o) {
		if(o.getClass() != nodeId.getClass())
			return false;
		byte[] id=(byte[])o;
		if(id.length != nodeId.length)
			return false;
		for(int i=0; i<id.length; i++)
			if(id[i] != nodeId[i])
				return false;
		return true;
	}


	//TODO to group Functions write getter and setter if neccessary

}
